package com.map.core.utils;

import org.apache.commons.net.telnet.TelnetClient;

import java.io.IOException;

public class TelnetUtils {
    /***
     *  telnet 操作
     * @param hostname
     * @return
     */
    public static boolean telnet(String hostname,Integer port){

        TelnetClient tc = new TelnetClient();
        tc.setConnectTimeout(3000);
        try {
            tc.connect(hostname, port);
        } catch (IOException e) {
            return false;
        }
        return true;
    }
}
